﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using laba2.Repository.IRepository;
using laba2.Repository.RepositoryImpl;

namespace laba2.IoC
{
   public class RepositoryInstaller : IWindsorInstaller
    {
       public void Install(IWindsorContainer container, IConfigurationStore store)
       {
          // container.Register(Classes.FromThisAssembly().Where(type => type.Name.EndsWith("Repository")));
          //container.Register(Component.For(typeof (IList<>)).ImplementedBy(typeof(List<>)));
           container.Register(Component.For(typeof (IRepository<>)).ImplementedBy(typeof (Repository<>)));
           container.Register(Component.For<IAchivementRepository>().ImplementedBy<AchivementRepository>());
           container.Register(Component.For<ICourseRepository>().ImplementedBy<CourseRepository>());
           container.Register(Component.For<IStudentRepository>().ImplementedBy<StudentRepository>());
           container.Register(Component.For<ITaskRepository>().ImplementedBy<TaskRepository>());
       }
    }
}
